package org.codefinger.dao.callback;

import java.math.BigInteger;
import java.sql.ResultSet;

import org.codefinger.dao.impl.ResultSetCallback;

public class BigIntegerQueryCallback implements ResultSetCallback<BigInteger> {

	public static final BigIntegerQueryCallback	INSTANCE	= new BigIntegerQueryCallback();

	private BigIntegerQueryCallback() {

	}

	@Override
	public BigInteger getResult(ResultSet resultSet, String[] aliases) throws Throwable {
		if (resultSet.next()) {
			return resultSet.getBigDecimal(1).toBigInteger();
		}
		return null;
	}

}
